/**
 *
 *  Project      :  UVa's acm
 *  Project site :  code.google.com/p/uvaacm/
 *  Author       :  Ives Liao
 *  E-Mail       :  iveslazycat at gmail.com
 *  Date         :  2011/11/17
 *  Website      :  iveslazycat.pixnet.net
 *  
 */
#ifdef ONLINE_JUDGE /* If compiler is UVa's online judge */
    #include<stdio.h> /*Include standard header foe UVa's compiler */
    #include<stdlib.h>
    #include<math.h>
    #define INPUT stdin /* Define the input is from standard input */
    #define LLINT "%lld"
#else
    #include"header.h" /* Include my own header */
    #define INPUT fptIn /* Define the input is from input file */
    #define LLINT "%I64d"
#endif
/*---------- Do sub function declare below here \/----------*/
/*---------- Do sub function declare above here /\----------*/
#ifdef ONLINE_JUDGE
	int main() {/* main() for UVa's online judge */
#else
    int acm_00913() {/* function name for my own */
        printf("--acm_00913 begin here--\n");/* Print begining of problem */
        FILE *fptIn = fopen("Resource/acm_00913.txt","r");/* Open input file to test */
        if ( fptIn == NULL )/* Distinguish the fptInIn file is load success. */
        {
            printf("File acm_00913.txt load fail.\n");/* Telling user file loading failed. */
            printf("Program will exit.\n");/* Telling user function gonna end. */
            return EXIT_FAILURE;/* Return to problem selector(main) */
        }
#endif
/*---------- Do primary statment below here \/----------*/
    unsigned long long int n;
    while( fscanf(INPUT,LLINT,&n) == 1 ){
        printf(LLINT,3*(3+n)*(n/2)-3 );
        printf("\n");
    }
/*---------- Do primary statment above here /\----------*/
    #ifndef ONLINE_JUDGE/* If compiler isn't UVa's online judge */
        printf("--acm_00913 end here--\n");/* Print end of problem */
        fclose(fptIn);/* Close file */
    #endif
    return 0;
}
/*---------- Do sub function statment below here /\----------*/

/*---------- Do sub function statment above here \/----------*/
